﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace ShootSearch.Runner
{
    public partial class FormConfiguration : Form
    {
        protected object config;

        public object Config
        {
            get { return config; }
            set { 
                config = value;
                propertyGridConfig.SelectedObject = config;
                
            }
        }

        public FormConfiguration()
        {
            InitializeComponent();
        }

        private void FormConfiguration_Load(object sender, EventArgs e)
        {

        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            config = propertyGridConfig.SelectedObject;
            this.DialogResult = DialogResult.OK;
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void propertyGridConfig_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            Debug.WriteLine(e.ChangedItem.ToString());
        }
    }
}
